/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Author: Huawei OS Kernel Lab
 * Create: Thu Aug 15 16:14:23 2023
 */

#ifndef __ASM_STACKPROTECTOR_H
#define __ASM_STACKPROTECTOR_H

#include <linux/compiler.h>

extern unsigned long __stack_chk_guard;

static __always_inline void boot_init_stack_canary(void)
{
	/* get canary the way as the hmlibc */
	__stack_chk_guard = (unsigned long)&__stack_chk_guard * 1103515245;
}

#endif /* __ASM_STACKPROTECTOR_H */
